package test.design.chain.mybatis;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Date;

public class CheckInterceptor implements Interceptor {

	@Override
	public Object interceptor(Object obj, Method method, Object[] args) {
		try {
			System.out.println("check start at " + new Date());
			Object result = method.invoke(obj, args);
			System.out.println("check end at " + new Date());
			return result;
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		}
		return null;
	}

}
